<?php
defined('IN_YuLin') || exit('NO PERMIT!');

$table = Table('article');
//删除
//ADD edit 通用post处理
//select del 通用get
if($a == 'del'){
    !is_array($_POST['del_ids']) and $ids = explode(',', $_POST['del_ids']);
    foreach($_POST['del_ids'] as $key => $val) $ids[$key] = intval($val);
    $db->exec('DELETE FROM '.$table.' WHERE id in ('.implode(",", $ids).')');
    AjaxReturn(['status'=>'1','msg'=>'删除成功']);
}
//列表
$where = ' FROM '.$table.' WHERE 1=1 and cid=9';
$tmp = $db->getrow('SELECT COUNT(1) AS p '.$where);
$page = max(1,intval($_GET['page']));
$size = 20;
$limit    = ' LIMIT '.($page - 1) * $size.','.$size;
$url = '?m='.$m.'&c='.$c.'&a='.$a;
$orderby = ' ORDER BY id ASC ';
$data = $db->getall('SELECT * '.$where.$orderby.$limit);
$multi = Multi($url,$page,$tmp['p'],$size);

$tpl->display($m.'/about');
?>